package Text_72;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;

public class Code {

	public static void main(String[] args) {
		 //获取年龄大于等于24的数据，并用map存储
        ArrayList<String> list = new ArrayList<>();
        //添加数据
        Collections.addAll(list,"zhangsan,23","lisi,24","wangwu,25");
        //Integer.parseInt，类型转换
        Map<String, Integer> collect = list.stream()
                .filter(s -> 24 <= Integer.parseInt(s.split(",")[1]))
                .collect(Collectors.toMap(
                        s -> s.split(",")[0],
                        s -> Integer.parseInt(s.split(",")[1])));
        System.out.println(collect);

	}

}
